﻿CREATE PROCEDURE [dbo].[sp_SubmitLOBUpdatesToServiceBus]

AS
	SELECT 
		 [MeterNumber]
		,[MeterVendorID]
		,[MeterHeadEndID]
		,[TimeStamp]
		,[EventType]
		,[Reading]
		,[Temp]
		,[Code]
		,[Status]
	FROM
		[AMI].[dbo].[SimulatedLOB]
	WHERE
		[PickedUp] = 'N'

	UPDATE
		[AMI].[dbo].[SimulatedLOB]
	SET
		[PickedUp] ='Y'
	WHERE
		[PickedUp] ='N'
		
RETURN 0